<!DOCTYPE html>
<html>

<head>
    <title>Demo</title>
    <meta charset="utf-8">
    <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0" />
    <meta name="format-detection" content="tephone=no,email=no,date=no,address=no">
    <!-- 1.7.1/1.11.1/2.1.1 -->
    <script type="text/javascript" src="http://space.cdn.ports-intl.com/Ports/Ports-intl/common/Lib/jQuery/Lib/jquery-1.7.1.min.js"></script>
    <!-- Latest compiled and minified CSS -->
    <link rel="stylesheet" href="http://space.cdn.ports-intl.com/Ports/Ports-intl/common/Lib/h5style/css/import-min.css">
    <link rel="stylesheet" type="text/css" href="api.css">
    <style type="text/css">
    html {
        background-color: white;
    }
    
    span {
        padding: 10px 15px;
        margin: 10px;
        display: inline-block;
        background-color: #e8e8e8;
    }
    
    .hover {
        opacity: .4;
    }
    </style>
</head>

<body>
    <div class="container-fluid">
        <div class="row">
            <div class="col-xs-6">
                这是第三个页面
                <button type="button" class="btn btn-info" onclick="closeF();">关闭</button>
                <br>
                <br>
                <button type="button" class="btn btn-danger" onclick="showDialog()">Alert</button>
                <br>
                <br>
                <button type="button" class="btn btn-danger" onclick="openSheet()">Sheet</button>
                <br>
                <br>
                <button type="button" class="btn btn-danger" onclick="OpenWind()">Open</button><br>
                <br><br>
                <button type="button" class="btn btn-danger" onclick="openSlider()">OpenSlider</button>
            </div>
        </div>
    </div>
    <script type="text/javascript">
    function closeF() {
        api.closeWin();
    }

    function showDialog() {
        api.toast({
            msg: '网络错误',
            duration: 2000,
            location: 'bottom'
        });
    }

    function openSheet() {
        api.actionSheet({
            title: '底部弹出框测试',
            cancelTitle: '这里是取消按钮',
            destructiveTitle: '红色警告按钮',
            buttons: ['1', '2', '3']
        }, function(ret, err) {
            if (ret) {
                api.toast({msg:JSON.stringify(ret),duration:2000,location:'bottom'});
            } else {
                api.toast({msg:JSON.stringify(err),duration:2000,location:'bottom'});
            }
        });
    }

    function OpenWind() {
        api.openWin({
            name: 'page3',
            url: '/ApiCloud/163/index.html?v=1',
            pageParam: {
                name: 'test'
            },
            bgColor: '#f00',
            animation: {
                // type: 'push'
                type: "push", //动画类型（详见动画类型常量）
                subType: "from_right", //动画子类型（详见动画子类型常量）
                duration: 400 //动画过渡时间，默认300毫秒
            },
            delay: 1000,
            showProgress: true,
            slidBackEnabled: true
        });
    }

    function openSlider(){
        api.openSlidLayout ({
            type: 'all',
            leftEdge: 80,
            rightEdge: 60,
            fixedPane: {
                name: 'win1', 
                url: '/ApiCloud/p3.html', 
                bgColor: '#fff', 
                bounces: true,
                vScrollBarEnabled: true,
                hScrollBarEnabled: false
            },
            slidPane: {
                name: 'win2', 
                url: '/ApiCloud/p4.html', 
                bgColor: '#fff', 
                bounces: true,
                vScrollBarEnabled: true,
                hScrollBarEnabled: false
            }
        }, function(ret, err){
        
        });
    }
    </script>
</body>

</html>
